package com.nuc.seckill.controller;

import com.nuc.seckill.model.SeckillAdmin;
import com.nuc.seckill.service.AdminService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author spider
 */
@Controller
@RequestMapping(value = "/admin")
@Slf4j
public class SeckillAdminController {

    @Resource
    private AdminService adminService;

    @RequestMapping("/listPageAdmin")
    public String listAdminPage(Model model) {

        List<SeckillAdmin> list = adminService.listAdmin();
        model.addAttribute("list", list);

        return "admin/listPageAdmin";
    }
}
